package 力扣日常刷题.木23一月.第19天319;

import java.util.Scanner;

public class Demo95 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] nums = new int[num];
        for(int i = 0;i<num;i++){
            nums[i]=sc.nextInt();
        }
        double sum = 0;
        for(int j = num-1;j>=0;j--){
            sum+=nums[j];
            sum/=2;
        }
        System.out.print((int)sum+1);
    }

}
